import java.util.Random;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数组的长度：");
        int count = scanner.nextInt();
        int[] arr = new int[count];
        for (int i = 0; i < count; i++) {
            Random random = new Random();
            int re = random.nextInt(10)+1;
            arr[i] = re;
        }
        System.out.print("数组中的元素为");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
        System.out.println();
        System.out.print("大于5且为偶数的元素为:");
        for (int i :arr) {
            if (i > 5 && i % 2 == 0) {
                System.out.print(i+" ");
            }
        }
    }
}
